package org.bbl.web;

import org.apache.wicket.request.IRequestParameters;
import org.apache.wicket.request.cycle.RequestCycle;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

/**
 * @author biniam.gebremichael
 * @since 4/7/13
 */
public class UserParameter {

    public static Map<String, String> getParameters() {
        final Map<String, String> parameters = new HashMap<String, String>();
        final IRequestParameters queryParameters = RequestCycle.get().getRequest().getQueryParameters();
        final Set<String> parameterNames = queryParameters.getParameterNames();
        for (String parameterName : parameterNames) {
            parameters.put(parameterName, queryParameters.getParameterValue(parameterName).toString());
        }
        return parameters;
    }
}
